#ifndef __VBI_BUFFER_H__
#define __VBI_BUFFER_H__


#include <basic_types.h>
#include <hld/vbi/vbi.h>
#include <mediatypes.h>	


#ifdef VBI_BUF_DEBUG
#define  SBF_ASSERT 	ASSERT
#else
#define  SBF_ASSERT(...)  do{}while(0)
#endif

//#define VBI_BS_LEN 20480//40960//20480//10240
#define VBI_BS_HDR_LEN 300//100//200//400

#define VBI_SBFAddr  	__MM_TTX_BS_START_ADDR
#define VBI_BS_LEN		__MM_TTX_BS_LEN
#define TTX_PageAddr  	__MM_TTX_PB_START_ADDR

#define LOOPBACK_SIZE	256

#ifdef __cplusplus
extern "C"
{
#endif

INT32 vbi_sbf_create(void);
INT32 vbi_sbf_wr_req(UINT32 * pSize, UINT8 ** ppData);
void vbi_sbf_wr_update(UINT32 Size);
INT32 vbi_sbf_rd_req(UINT32 * pSize, UINT8 ** ppData);
void vbi_sbf_rd_update(UINT32 Size);
INT32 vbi_hdr_buf_create(void);
INT32 vbi_hdr_buf_wr_req(UINT32* pData);
void vbi_hdr_buf_wr_update();
INT32 vbi_hdr_buf_rd_req(UINT32 * pData);
void vbi_hdr_buf_rd_update();

void pbf_create();
INT32 pbf_wr_req(UINT16 page_id , struct PBF_CB ** cb );
void pbf_wr_update(struct PBF_CB * cb);
INT32 pbf_rd_req(UINT16 page_id , struct PBF_CB ** cb );
INT32 pbf_rd_req_up(UINT16 page_id, struct PBF_CB ** cb  );
INT32 pbf_rd_req_down(UINT16 page_id , struct PBF_CB ** cb );



#ifdef __cplusplus
}
#endif


#endif /* __VBI_BUFFER_H__ */


